package com.eversec.action.check;

import com.eversec.util.file.FileRead;
import com.smcs.idcmanager.service.IdcManager;
import com.smcs.idcmanager.service.impl.IdcManagerImpl;

/**
 * 对用户上传的文件进行逻辑校对
 * 
 * @author Administrator
 * 
 */
public class LogicCheck {

	/**
	 * 对目录1下的基本信息进行逻辑校对
	 * 
	 * @param xmlPath
	 * @return
	 */
	public static boolean basicInfoCheck(String xmlPath) {
		boolean flag = false;

		String xmlString = FileRead.readFileByLines(xmlPath);
		if (xmlString != null) {
			try {
				IdcManager idcMgr = new IdcManagerImpl();
				idcMgr.saveCommonData(xmlString);

				flag = true;
			} catch (Exception e) {
				throw new RuntimeException(e.getCause() + " : " + e.getMessage());
			}
		}

		return flag;
	}

}
